package org.anyin.gitee.cloud.lib.core.utils;

import java.util.UUID;

public class RequestIdUtil {

	private static final ThreadLocal<UUID> requestIdHolder = new ThreadLocal<UUID>();

    public static void generateRequestId() {
        requestIdHolder.set(UUID.randomUUID());
    }

    public static void generateRequestId(UUID uuid) {
        requestIdHolder.set(uuid);
    }

    public static UUID getRequestId() {
        return requestIdHolder.get();
    }

    public static void removeRequestId() {
        requestIdHolder.remove();
    }
}
